/**
 * Gadget.java
 */
package edu.gatech.startrader.ship;

/**
 * Gadget Enumerated Type
 * Gadgets that Ships can use to enhance performance/functionality
 * @author Team Bamf (Team 30)
 * @version 1.0
 */
public enum Gadget {
	/**
	 * Gadget that increases the number of cargo holds the ship has
	 */
	ADDITIONAL_CARGO_BAYS,
	
	/**
	 * Gadget that helps the ship navigate the galaxy
	 */
	NAVIGATION_SYSTEM,
	
	/**
	 * Gadget that automatically repairs the ship's hulls over time
	 */
	AUTO_REPAIR_SYSTEM,
	
	/**
	 * Gadget that helps the ship aim at enemy ships
	 */
	TARGETING_SYSTEM,
	
	/**
	 * Gadget that allows the ship have a chance to slip
	 * past other ships without being seen
	 */
	CLOAKING_SYSTEM;
	
	/**
	 * Returns the Gadget object as a String
	 * @return the object as a String
	 */
	public String toString() {
		final String name = super.toString();
		final StringBuilder result = new StringBuilder(name.length());
		final String[] words = name.toLowerCase().split("_");
		for(int i = 0; i < words.length; ++i) {
			if(i > 0) {
				result.append(' ');
			}
		  	result.append(Character.toUpperCase(words[i].charAt(0)));
		  	result.append(words[i].substring(1));
		}
		return result.toString();
	}
}
